<?php
require 'db.php';

$strsql = "select * from tb_shangpin left join tb_category on tb_shangpin.category = tb_category.Id ";
if(!empty($_POST['search'])){
    $strsql  .= " where name like '%".$_POST['search']."%'"; //模糊匹配
}

$result = mysqli_query($link, $strsql);
$data = mysqli_fetch_all($result);

require 'fanye.php';


mysqli_free_result($result);
mysqli_close($link);



require 'index.html';
?>
